package no.gnet.edvd.types;

public class Player extends Persist {
	private static final long serialVersionUID = -6261882956952793848L;
	public String firstname;
	public String lastname;
	public String email;
	private boolean p2p=true;
	
	PaymentAccount paymentAccount;

	public Player(){
		
	}
	
	public static Player getSystemUser() {
		return new Player("EddeVedde", "EddeVedde", "mr.eddevedde@gmail.com");
	}
	

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((email == null) ? 0 : email.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Player other = (Player) obj;
		if (email == null) {
			if (other.email != null)
				return false;
		} else if (!email.equals(other.email))
			return false;
		return true;
	}

	public Player(String firstname, String lastname, String email) {
		super();
		this.firstname = firstname;
		this.lastname = lastname;
		this.email = email;
	}

	public Player(String email) {
		super();
		this.email = email;
	}

	public Player(String email, int id) {
		super();
		this.id=id;
		this.email=email;
	}

	public String getFirstname() {
		return firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public String getEmail() {
		return email;
	}

	@Override
	public String toString() {
		return "Player [firstname=" + firstname + ", lastname=" + lastname + ", email=" + email + ", id=" + id + "]";
	}

	public PaymentAccount getPaymentAccount() {
		return paymentAccount;
	}

	public void setPaymentAccount(PaymentAccount account) {
		this.paymentAccount = account;
	}

	public boolean isP2p() {
		return p2p;
	}

	public void setP2p(boolean p2p) {
		this.p2p = p2p;
	}

}
